From 398a3f5679a670c0901961137d32d447b2bc90b8 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 13 Sep 2005 10:05:49 +0000 Subject: [PATCH] Prevent opening the xenbus device if the store isn't connected yet. Running xenstore clients using the xenbus device before the store connection has been set up causes a crash because the store page won't have been allocated yet. This is only a problem in dom0 where we setup the store page from the PRIVCMD_INITDOMAIN_STORE ioctl. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c index fd5ab73fe9..c5bdeb4e8c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c @@ -130,6 +130,9 @@ static int xenbus_dev_open(struct inode *inode, struct file *filp) { struct xenbus_dev_data *u; + if (xen_start_info->store_evtchn == 0) + return -ENOENT; + /* Don't try seeking. */ nonseekable_open(inode, filp); -- 2.30.2